﻿using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ManageData
{
    public class BasicDbContext : DbContext
    {

        public DbSet<BasicEntity> BasicEntities => Set<BasicEntity>(); public DbSet<MainEntity> MainEntities => Set<MainEntity>();
        public DbSet<SubEntity> SubEntities => Set<SubEntity>();

        public BasicDbContext()
        {
                
        }

        public BasicDbContext(DbContextOptions options):base (options) 
        {
                
        }

        public BasicDbContext(DbContextOptions<BasicDbContext> options):base(options)
        {
            
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
            optionsBuilder.UseSqlServer();

            // 注册保存拦截器
            //optionsBuilder.AddInterceptors(new MySaveChangesInterceptor());
        }


    }
}
